<template>
     <tr>
          <td>
            <input type="checkbox" /> <span></span>
          </td>
          <td>{{name}}</td>
          <td>{{price}}</td>
          <td><button @click="down(index)">-</button>{{num}}<button @click="add(index)">+</button></td>
          <td>{{price*num}} </td>
          <td><button @click="del(index)">删除</button></td>
      </tr>
      
</template>

<script>
  
  export default {
  props: ['name', 'price', 'num', 'checked', 'index'],
  methods: {
    down(index) {
        this.$emit('dec',index)
    },
    add(index) {
      this.$emit('add',index)
    },
    del(index) {
        this.$emit("delFn",index)
      }
    }
  }
</script>

<style scoped>

</style>